﻿using System;
using System.Collections.Generic;
using SharpSqlAnalyzer.pp.processor.type.comm;
using SharpSqlAnalyzer.stmt;

namespace SharpSqlAnalyzer.pp.stmtformatter.type.comm
{
	// Token: 0x0200020D RID: 525
	public class PlsqlBlockStmtFormatter : AbstractStmtFormatter
	{
		// Token: 0x06001224 RID: 4644 RVA: 0x003180EC File Offset: 0x003162EC
		public virtual void addDeclareProcessor(AbstractProcessor p)
		{
			if (this.declareProcessors == null)
			{
				this.declareProcessors = new List<AbstractProcessor>();
			}
			this.declareProcessors.Add(p);
		}

		// Token: 0x06001225 RID: 4645 RVA: 0x0031810D File Offset: 0x0031630D
		public virtual void addBodyProcessor(AbstractProcessor p)
		{
			if (this.bodyProcessors == null)
			{
				this.bodyProcessors = new List<AbstractProcessor>();
			}
			this.bodyProcessors.Add(p);
		}

		// Token: 0x06001226 RID: 4646 RVA: 0x0031812E File Offset: 0x0031632E
		public virtual void addBeginAndEndProcessor(AbstractProcessor p)
		{
			if (this.beginAndEndProcessors == null)
			{
				this.beginAndEndProcessors = new List<AbstractProcessor>();
			}
			this.beginAndEndProcessors.Add(p);
		}

		// Token: 0x06001227 RID: 4647 RVA: 0x00318150 File Offset: 0x00316350
		protected internal override void doFormat(TCustomSqlStatement stmtArg)
		{
			TCommonBlock tcommonBlock = stmtArg as TCommonBlock;
			this.runProcessor<TCommonBlock>(this.SpecialProcessors, tcommonBlock);
			this.runProcessor<TCommonBlock>(this.beginAndEndProcessors, tcommonBlock);
			if (tcommonBlock.BodyStatements != null)
			{
				this.runProcessor<TStatementList>(this.bodyProcessors, tcommonBlock.BodyStatements);
			}
			if (tcommonBlock.DeclareStatements != null)
			{
				this.runProcessor<TStatementList>(this.declareProcessors, tcommonBlock.DeclareStatements);
			}
		}

		// Token: 0x040013DF RID: 5087
		private IList<AbstractProcessor> declareProcessors;

		// Token: 0x040013E0 RID: 5088
		private IList<AbstractProcessor> bodyProcessors;

		// Token: 0x040013E1 RID: 5089
		private IList<AbstractProcessor> beginAndEndProcessors;
	}
}
